<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:p="clr-namespace:ContactTracing.CaseView.Properties"
    xmlns:wpf="clr-namespace:ContactTracing.Controls;assembly=ContactTracing.WPF"
    xmlns:core="clr-namespace:ContactTracing.Core;assembly=ContactTracing.Core"
    xmlns:localconverters="clr-namespace:ContactTracing.CaseView.Converters"
    xmlns:converters="clr-namespace:ContactTracing.Core.Converters;assembly=ContactTracing.Core"
    xmlns:controls="clr-namespace:ContactTracing.CaseView.Controls">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/ContactTracing.WPF;component/Themes/Generic.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style TargetType="{x:Type TextBox}">
        <Setter Property="Validation.ErrorTemplate">
            <Setter.Value>
                <ControlTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Border BorderThickness="1" BorderBrush="#FFdc000c" VerticalAlignment="Top">
                            <Grid>
                                <AdornedElementPlaceholder x:Name="adorner" Margin="-1"/>
                            </Grid>
                        </Border>
                        <Border x:Name="errorBorder" Background="#FFdc000c" Margin="8,0,0,0"
                                Opacity="1" CornerRadius="0"
                                IsHitTestVisible="False"
                                MinHeight="24" >
                            <TextBlock Text="{Binding ElementName=adorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}"
                                       Foreground="White" Margin="8,2,8,3" TextWrapping="Wrap" VerticalAlignment="Center"/>
                        </Border>
                    </StackPanel>
                    <!--<ControlTemplate.Triggers>
                            <DataTrigger Value="True">
                                <DataTrigger.Binding>
                                    <Binding ElementName="adorner" Path="AdornedElement.IsKeyboardFocused" />
                                </DataTrigger.Binding>
                                <DataTrigger.EnterActions>
                                    <BeginStoryboard x:Name="fadeInStoryboard">
                                        <Storyboard>
                                            <DoubleAnimation Duration="00:00:00.15"
                                                         Storyboard.TargetName="errorBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"/>
                                        </Storyboard>
                                    </BeginStoryboard>
                                </DataTrigger.EnterActions>
                                <DataTrigger.ExitActions>
                                    <StopStoryboard BeginStoryboardName="fadeInStoryboard"/>
                                    <BeginStoryboard x:Name="fadeOutStoryBoard">
                                        <Storyboard>
                                            <DoubleAnimation Duration="00:00:00"
                                                         Storyboard.TargetName="errorBorder"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="0"/>
                                        </Storyboard>
                                    </BeginStoryboard>
                                </DataTrigger.ExitActions>
                            </DataTrigger>
                        </ControlTemplate.Triggers>-->
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="{x:Type DatePicker}">
        <Setter Property="Validation.ErrorTemplate">
            <Setter.Value>
                <ControlTemplate>
                    <StackPanel Orientation="Horizontal"  ClipToBounds="False">
                        <Border BorderThickness="1" BorderBrush="#FFdc000c" VerticalAlignment="Top">
                            <Grid>
                                <AdornedElementPlaceholder x:Name="adorner" Margin="-1"/>
                            </Grid>
                        </Border>
                        <Border x:Name="errorBorder" Background="#FFdc000c" Margin="8,0,0,0" ClipToBounds="False"
                                Opacity="1" CornerRadius="0"
                                IsHitTestVisible="False"
                                MinHeight="24" MaxWidth="220" >
                            <TextBlock Text="{Binding ElementName=adorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}"
                                       Foreground="White" Margin="8,2,8,3" TextWrapping="Wrap" VerticalAlignment="Center"/>
                        </Border>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <localconverters:EpiCaseClassificationConverter x:Key="EpiCaseClassificationConverter" />
    <localconverters:GenderConverter x:Key="GenderConverter" />
    <localconverters:AliveDeadConverter x:Key="AliveDeadConverter" />
    <localconverters:FinalLabClassificationConverter x:Key="FinalLabClassificationConverter" />
    <localconverters:PCRToEnabledConverter x:Key="PCRToEnabledConverter" />
    <localconverters:EbolaToVisibilityConverter x:Key="EbolaToVisibilityConverter" />
    <localconverters:MarburgToVisibilityConverter x:Key="MarburgToVisibilityConverter" />
    <localconverters:AliveDeadToEnabledConverter x:Key="AliveDeadToEnabledConverter" />
    <localconverters:MultiBooleanCaseWindowToEnabledConverter x:Key="MultiBooleanCaseWindowToEnabledConverter" />
    <localconverters:TaskbarProgressStateToBooleanConverter x:Key="TaskbarProgressStateToBooleanConverter" />

    <x:Array x:Key="RecordProcessingScopeListString" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="Active" DisplayString="Active records only" />
        <core:ComboBoxItemString ValueString="Deleted" DisplayString="Deleted records only" />
        <core:ComboBoxItemString ValueString="Both" DisplayString="Both active and deleted records" />
    </x:Array>
    
    <x:Array x:Key="AgTiterListString" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="" DisplayString="" />
        <core:ComboBoxItemString ValueString="1:4" DisplayString="1:4" />
        <core:ComboBoxItemString ValueString="1:16" DisplayString="1:16" />
        <core:ComboBoxItemString ValueString="1:64" DisplayString="1:64" />
        <core:ComboBoxItemString ValueString="1:256" DisplayString="1:256" />
    </x:Array>

    <x:Array x:Key="TiterListString" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="" DisplayString="" />
        <core:ComboBoxItemString ValueString="1:100" DisplayString="1:100" />
        <core:ComboBoxItemString ValueString="1:400" DisplayString="1:400" />
        <core:ComboBoxItemString ValueString="1:1600" DisplayString="1:1600" />
        <core:ComboBoxItemString ValueString="1:6400" DisplayString="1:6400" />
    </x:Array>

    <x:Array x:Key="SampleTypeListString" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="" DisplayString="" />
        <core:ComboBoxItemString ValueString="1" DisplayString="{x:Static p:Resources.SampleTypeWholeBlood}" />
        <core:ComboBoxItemString ValueString="2" DisplayString="{x:Static p:Resources.SampleTypeSerum}" />
        <core:ComboBoxItemString ValueString="3" DisplayString="{x:Static p:Resources.SampleTypeHeartBlood}" />
        <core:ComboBoxItemString ValueString="4" DisplayString="{x:Static p:Resources.SampleTypeSkin}" />
        <core:ComboBoxItemString ValueString="6" DisplayString="{x:Static p:Resources.SampleTypeSalivaSwab}" />
        <core:ComboBoxItemString ValueString="5" DisplayString="{x:Static p:Resources.SampleTypeOther}" />
    </x:Array>

    <x:Array x:Key="OtherTestResultListString" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="" DisplayString="" />
        <core:ComboBoxItemString ValueString="1" DisplayString="{x:Static p:Resources.Positive}" />
        <core:ComboBoxItemString ValueString="2" DisplayString="{x:Static p:Resources.Negative}" />
        <core:ComboBoxItemString ValueString="3" DisplayString="n/a" />
    </x:Array>

    <x:Array x:Key="PCRListString" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="" DisplayString="" />
        <core:ComboBoxItemString ValueString="1" DisplayString="{x:Static p:Resources.Positive}" />
        <core:ComboBoxItemString ValueString="2" DisplayString="{x:Static p:Resources.Negative}" />
        <core:ComboBoxItemString ValueString="3" DisplayString="{x:Static p:Resources.SampleInterpretationIndeterminate}" />
        <core:ComboBoxItemString ValueString="4" DisplayString="n/a" />
    </x:Array>

    <x:Array x:Key="SampleInterpretListString" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="" DisplayString="" />
        <core:ComboBoxItemString ValueString="1" DisplayString="{x:Static p:Resources.SampleInterpretationConfirmedAcute}" />
        <core:ComboBoxItemString ValueString="2" DisplayString="{x:Static p:Resources.SampleInterpretationConfirmedConvalescent}" />
        <core:ComboBoxItemString ValueString="3" DisplayString="{x:Static p:Resources.SampleInterpretationNotCase}" />
        <core:ComboBoxItemString ValueString="4" DisplayString="{x:Static p:Resources.SampleInterpretationIndeterminate}" />
        <core:ComboBoxItemString ValueString="5" DisplayString="{x:Static p:Resources.SampleInterpretationNegativeNeedFollowUp}" />
    </x:Array>

    <x:Array x:Key="FinalLabClassificationListString" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="" DisplayString="" />
        <core:ComboBoxItemString ValueString="0" DisplayString="{x:Static p:Resources.NotCase}" />
        <core:ComboBoxItemString ValueString="1" DisplayString="{x:Static p:Resources.SampleInterpretationConfirmedAcute}" />
        <core:ComboBoxItemString ValueString="2" DisplayString="{x:Static p:Resources.SampleInterpretationConfirmedConvalescent}" />
        <core:ComboBoxItemString ValueString="3" DisplayString="{x:Static p:Resources.SampleInterpretationIndeterminate}" />
        <core:ComboBoxItemString ValueString="4" DisplayString="{x:Static p:Resources.AnalysisClassNeedsFollowUp}" />
    </x:Array>
    
    <x:Array x:Key="YNUListStringNoMissing" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="1" DisplayString="{x:Static p:Resources.Yes}" />
        <core:ComboBoxItemString ValueString="2" DisplayString="{x:Static p:Resources.No}" />
        <core:ComboBoxItemString ValueString="3" DisplayString="{x:Static p:Resources.PrintedFormUnknown}" />
    </x:Array>

    <x:Array x:Key="YNUListString" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="" DisplayString="" />
        <core:ComboBoxItemString ValueString="1" DisplayString="{x:Static p:Resources.Yes}" />
        <core:ComboBoxItemString ValueString="2" DisplayString="{x:Static p:Resources.No}" />
        <core:ComboBoxItemString ValueString="3" DisplayString="{x:Static p:Resources.PrintedFormUnknown}" />
    </x:Array>

    <x:Array x:Key="AliveDeadListString" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="" DisplayString="" />
        <core:ComboBoxItemString ValueString="1" DisplayString="{x:Static p:Resources.Dead}" />
        <core:ComboBoxItemString ValueString="2" DisplayString="{x:Static p:Resources.Alive}" />
    </x:Array>

    <x:Array x:Key="AliveDeadBothListString" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="" DisplayString="" />
        <core:ComboBoxItemString ValueString="1" DisplayString="{x:Static p:Resources.Dead}" />
        <core:ComboBoxItemString ValueString="2" DisplayString="{x:Static p:Resources.Alive}" />
        <core:ComboBoxItemString ValueString="3" DisplayString="Alive and Dead" />
    </x:Array>

    <x:Array x:Key="EpiCaseClassificationListString" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="0" DisplayString="{x:Static p:Resources.NotCase}" />
        <core:ComboBoxItemString ValueString="1" DisplayString="{x:Static p:Resources.Confirmed}" />
        <core:ComboBoxItemString ValueString="2" DisplayString="{x:Static p:Resources.Probable}" />
        <core:ComboBoxItemString ValueString="3" DisplayString="{x:Static p:Resources.Suspect}" />
        <core:ComboBoxItemString ValueString="4" DisplayString="{x:Static p:Resources.Excluded}" />
    </x:Array>

    <x:Array x:Key="AgeUnitListString" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="" DisplayString="" />
        <core:ComboBoxItemString ValueString="{x:Static p:Resources.AgeUnitYears}" DisplayString="{x:Static p:Resources.AgeUnitYears}" />
        <core:ComboBoxItemString ValueString="{x:Static p:Resources.AgeUnitMonths}" DisplayString="{x:Static p:Resources.AgeUnitMonths}" />
    </x:Array>

    <x:Array x:Key="SexListString" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="" DisplayString="" />
        <core:ComboBoxItemString ValueString="1" DisplayString="{x:Static p:Resources.Male}" />
        <core:ComboBoxItemString ValueString="2" DisplayString="{x:Static p:Resources.Female}" />
    </x:Array>

    <x:Array x:Key="PlaceDeathListString" Type="core:ComboBoxItemString">
        <core:ComboBoxItemString ValueString="" DisplayString="" />
        <core:ComboBoxItemString ValueString="1" DisplayString="{x:Static p:Resources.PlaceDeathCommunity}" />
        <core:ComboBoxItemString ValueString="2" DisplayString="{x:Static p:Resources.PlaceDeathHospital}" />
        <core:ComboBoxItemString ValueString="3" DisplayString="{x:Static p:Resources.PlaceDeathOther}" />
    </x:Array>

    <Style x:Key="IndividualReportBorderStyle" TargetType="Border">
        <Setter Property="BorderBrush" Value="{StaticResource IndividualReportBorderBrush}" />
        <Setter Property="BorderThickness" Value="1, 1, 0, 1" />
    </Style>

    <Style TargetType="{x:Type controls:SubTabButton}">
        <Setter Property="Foreground" Value="{StaticResource MediumTextBrush}"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Border BorderThickness="{TemplateBinding BorderThickness}" 
                    BorderBrush="{TemplateBinding BorderBrush}" 
                    Background="{TemplateBinding Background}" 
                    Padding="{TemplateBinding Padding}" 
                    CornerRadius="0">
                        <ContentControl VerticalAlignment="Center" HorizontalAlignment="Center">
                            <TextBlock Name="PART1" Style="{StaticResource Heading1}" Foreground="{TemplateBinding Foreground}"  VerticalAlignment="Center" HorizontalAlignment="Center" Text="{TemplateBinding Content}"/>
                        </ContentControl>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsChecked" Value="True">
                <Setter Property="Foreground" Value="{StaticResource AccentBrush}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Foreground" Value="{StaticResource DarkTextBrush}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type controls:TabButton}" x:Key="OldStyleTabButton">
        <Setter Property="Foreground" Value="{StaticResource DarkTextBrush}"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid x:Name="Grid">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="16" />
                        </Grid.RowDefinitions>
                        <Border 
                                    x:Name="Border" 
                                    Height="38"
                                    CornerRadius="0" 
                                    BorderThickness="0, 0, 0, 4"
                                    Margin="0, 0, 0, 0"
                                    Background="{StaticResource HatchForegroundBrush}"
                                TextBlock.FontSize="18"
                            TextBlock.FontWeight="SemiBold"
                                    BorderBrush="{StaticResource TabUnderlineBrush}">
                            <ContentPresenter 
                                    Margin="2"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    RecognizesAccessKey="True"/>
                        </Border>

                        <Path x:Name="Path" Grid.Row="1" Grid.RowSpan="1" Grid.Column="0" Canvas.ZIndex="2000" Height="7" Width="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,-1,15.375,0" 
                              Fill="{StaticResource TabUnderlineBrush}" Stroke="{StaticResource TabUnderlineBrush}"
                  Stretch="Fill" Data="M85,25 L85,25 L87.5,30 L90,25 z" RenderTransformOrigin="3.083,-1.417" Visibility="Collapsed"
                  StrokeThickness="0" />
                    </Grid>

                    <ControlTemplate.Triggers>
                        <!--<Trigger Property="IsKeyboardFocused" Value="true">
                                    <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DefaultedBorderBrush}" />
                                </Trigger>-->
                        <Trigger Property="IsChecked" Value="true">
                            <!--<Setter Property="Foreground" Value="#FFF2F2F2"/>-->
                            <Setter Property="Foreground" Value="{StaticResource HatchBackgroundBrush}"/>
                            <!--<Setter TargetName="Border" Property="Background" Value="#FF5EA8DE" />-->
                            <!--<Setter TargetName="Border" Property="Background" Value="{StaticResource DarkTextBrush}" />-->
                            <Setter TargetName="Border" Property="Background" Value="#002B4A" />
                            <Setter TargetName="Path" Property="Visibility" Value="Visible" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource AccentBrush}" />
                            <Setter TargetName="Path" Property="Stroke" Value="{StaticResource AccentBrush}" />
                            <Setter TargetName="Path" Property="Fill" Value="{StaticResource AccentBrush}" />
                            <!--<Setter TargetName="Border" Property="BorderBrush" Value="#FF5EA8DE" />-->
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Foreground" Value="White"/>
                            <!--<Setter TargetName="Border" Property="Background" Value="#F7F7F7" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="#FF5EA8DE" />-->
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <!--<Setter TargetName="Border" Property="Background" Value="#777879" />-->
                            <!--<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />-->
                            <Setter Property="Foreground" Value="#D8DADA"/>
                        </Trigger>
                    </ControlTemplate.Triggers>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style TargetType="{x:Type controls:TabButton}">
        <Setter Property="Foreground" Value="{StaticResource DarkTextBrush}"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Border 
                        x:Name="Border" 
                        MinHeight="32"
                        CornerRadius="0" 
                        BorderThickness="0, 0, 1, 1"
                        Margin="0, 0, 0, 0"
                        Background="#EDEDF0"
                        TextBlock.FontSize="18"
                        TextBlock.FontWeight="SemiBold"
                        BorderBrush="#BCBCBF">
                        <ContentPresenter 
                                Margin="2"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                RecognizesAccessKey="True"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="true">
                            <!--<Setter Property="Foreground" Value="{StaticResource HatchBackgroundBrush}"/>-->
                            <Setter TargetName="Border" Property="Background" Value="#CDCDD0" />
                            <!--<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource AccentBrush}" />-->
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Foreground" Value="#888889"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="#D8DADA"/>
                        </Trigger>
                    </ControlTemplate.Triggers>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <HierarchicalDataTemplate x:Key="LabResultsSummaryViewItemTemplate">
        <Border Style="{StaticResource ProjectBorderStyle}" x:Name="PART_Border" IsHitTestVisible="True" HorizontalAlignment="Left">
            <Grid>
                <Button Style="{StaticResource BacklessButtonStyle}" BorderThickness="0" Command="{Binding CaseVM.LabResultSelectedCommand}" CommandParameter="{Binding}">
                    <Button.Content>
                        <Grid x:Name="grdResult" Width="360" Height="160" Style="{StaticResource LabResultGridStyle}">
                            <!--<Grid.ContextMenu>
                        <ContextMenu>
                            <MenuItem 
                                Visibility="Visible"
                                IsEnabled="{Binding IsCheckingConnection, Converter={StaticResource BooleanInverter}}"
                                Header="Copy PRJ File" 
                                Command="{Binding CopyProjectCommand}" />
                            <MenuItem 
                                Visibility="Visible"
                                IsEnabled="{Binding IsCheckingConnection, Converter={StaticResource BooleanInverter}}"
                                Header="Change Connection Information" 
                                Command="{Binding ChangeConnectionInformationCommand}" />
                        </ContextMenu>
                    </Grid.ContextMenu>-->
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>

                            <TextBlock Foreground="#333333" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="10, 10, 10, 0" FontSize="17" FontWeight="SemiBold" Text="{Binding SampleNumber}"  IsHitTestVisible="False"/>

                            <TextBlock Foreground="#626262" Grid.Row="1" Grid.Column="0" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{x:Static p:Resources.ShortFormFieldLabSpecID}" IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="2" Grid.Column="0" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{x:Static p:Resources.ShortFormSampleInterpretation}" IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="3" Grid.Column="0" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{x:Static p:Resources.ShortFormSampleType}" IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="4" Grid.Column="0" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{x:Static p:Resources.ShortFormDateSampleCollected}" IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="5" Grid.Column="0" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{x:Static p:Resources.ShortFormDateSampleTested}" IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="6" Grid.Column="0" Margin="10, 0, 10, 10" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{x:Static p:Resources.ShortLabFormDaysAcute}" IsHitTestVisible="False"/>

                            <TextBlock Foreground="#626262" Grid.Row="1" Grid.Column="1" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{Binding FieldLabSpecimenID}"  IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="2" Grid.Column="1" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{Binding SampleInterpretation}" IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="3" Grid.Column="1" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{Binding SampleTypeLocalized}" IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="4" Grid.Column="1" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{Binding DateSampleCollected, StringFormat='dd/MM/yyyy', ValidatesOnNotifyDataErrors=False, NotifyOnValidationError=False}" IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="5" Grid.Column="1" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{Binding DateSampleTested, StringFormat='dd/MM/yyyy', ValidatesOnNotifyDataErrors=False, NotifyOnValidationError=False}" IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="6" Grid.Column="1" Margin="10, 0, 10, 10" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{Binding DaysAcute, ValidatesOnNotifyDataErrors=False, NotifyOnValidationError=False}" IsHitTestVisible="False"/>

                        </Grid>
                    </Button.Content>
                </Button>
            </Grid>
        </Border>

        <DataTemplate.Triggers>
            <EventTrigger RoutedEvent="FrameworkElement.Loaded" SourceName="PART_Border">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetName="PART_Border" Duration="00:00:00.125"
                                         Storyboard.TargetProperty="Opacity" From="0" To="1" />
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </DataTemplate.Triggers>

    </HierarchicalDataTemplate>


    <Style TargetType="{x:Type wpf:LabResultsSummaryView}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate x:Name="x1" TargetType="{x:Type wpf:LabResultsSummaryView}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <ItemsPresenter DockPanel.Dock="Bottom" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <WrapPanel Orientation="Vertical" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="{x:Type ContentPresenter}">
                    <Setter Property="Height" Value="Auto"></Setter>
                    <Setter Property="Margin" Value="0,0,2,2"></Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemTemplate" Value="{StaticResource LabResultsSummaryViewItemTemplate}" />
    </Style>







    <HierarchicalDataTemplate x:Key="SourceCasesSummaryViewItemTemplate">
        <Border Style="{StaticResource ProjectBorderStyle}" x:Name="PART_Border" IsHitTestVisible="True" HorizontalAlignment="Left">
            <Grid>
                <Button Style="{StaticResource BacklessButtonStyle}" BorderThickness="0" Command="{Binding CaseVM.SourceCaseSelectedCommand}" CommandParameter="{Binding}">
                    <Button.Content>
                        <Grid x:Name="grdResult" Width="360" Height="128" Style="{StaticResource LabResultGridStyle}">
                            <!--<Grid.ContextMenu>
                        <ContextMenu>
                            <MenuItem 
                                Visibility="Visible"
                                IsEnabled="{Binding IsCheckingConnection, Converter={StaticResource BooleanInverter}}"
                                Header="Copy PRJ File" 
                                Command="{Binding CopyProjectCommand}" />
                            <MenuItem 
                                Visibility="Visible"
                                IsEnabled="{Binding IsCheckingConnection, Converter={StaticResource BooleanInverter}}"
                                Header="Change Connection Information" 
                                Command="{Binding ChangeConnectionInformationCommand}" />
                        </ContextMenu>
                    </Grid.ContextMenu>-->
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>

                            <TextBlock Foreground="#333333" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="10, 10, 10, 0" FontSize="17" FontWeight="SemiBold" Text="{Binding ID}"  IsHitTestVisible="False"/>

                            <TextBlock Foreground="#626262" Grid.Row="1" Grid.Column="0" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{x:Static p:Resources.ShortFormFieldLabSpecID}" IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="2" Grid.Column="0" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{x:Static p:Resources.ShortFormSampleInterpretation}" IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="3" Grid.Column="0" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{x:Static p:Resources.ShortFormSampleType}" IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="4" Grid.Column="0" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{x:Static p:Resources.ShortFormDateSampleCollected}" IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="5" Grid.Column="0" Margin="10, 0, 10, 10" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{x:Static p:Resources.ShortFormDateSampleTested}" IsHitTestVisible="False"/>

                            <TextBlock Foreground="#626262" Grid.Row="1" Grid.Column="1" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{Binding LastName}"  IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="2" Grid.Column="1" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{Binding FirstName}" IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="3" Grid.Column="1" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{Binding DateLastContact, StringFormat='dd/MM/yyyy'}" IsHitTestVisible="False"/>
                            <TextBlock Foreground="#626262" Grid.Row="4" Grid.Column="1" Margin="10, 0, 10, 0" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{Binding Relationship, StringFormat='dd/MM/yyyy'}" IsHitTestVisible="False"/>
                            <!--<TextBlock Foreground="#626262" Grid.Row="5" Grid.Column="1" Margin="10, 0, 10, 10" FontSize="13" VerticalAlignment="Top" TextWrapping="Wrap" Text="{Binding DateSampleTested, StringFormat='dd/MM/yyyy'}" IsHitTestVisible="False"/>-->

                        </Grid>
                    </Button.Content>
                </Button>
            </Grid>
        </Border>

        <DataTemplate.Triggers>
            <EventTrigger RoutedEvent="FrameworkElement.Loaded" SourceName="PART_Border">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetName="PART_Border" Duration="00:00:00.125"
                                         Storyboard.TargetProperty="Opacity" From="0" To="1" />
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </DataTemplate.Triggers>

    </HierarchicalDataTemplate>


    <Style TargetType="{x:Type wpf:SourceCasesSummaryView}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate x:Name="x1" TargetType="{x:Type wpf:SourceCasesSummaryView}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <ItemsPresenter DockPanel.Dock="Bottom" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <WrapPanel Orientation="Vertical" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="{x:Type ContentPresenter}">
                    <Setter Property="Height" Value="Auto"></Setter>
                    <Setter Property="Margin" Value="0,0,2,2"></Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemTemplate" Value="{StaticResource SourceCasesSummaryViewItemTemplate}" />
    </Style>

    <Style TargetType="{x:Type controls:SearchBox}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:SearchBox}">
                    <Border BorderBrush="{StaticResource DataGridGridLineBrush}" BorderThickness="1" Background="White" HorizontalAlignment="Left">
                        <StackPanel Orientation="Horizontal">
                            <StackPanel.InputBindings>
                                <KeyBinding Key="Enter" Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:SearchBox}, Mode=FindAncestor}, UpdateSourceTrigger=PropertyChanged, Path=Search}"  />
                            </StackPanel.InputBindings>
                            <Grid>
                                <Label Visibility="{Binding ElementName=txtSearch, Path=Text.Length, Converter={StaticResource ResourceKey=LengthToVisibilityConverter}}" Name="lblSearch" FontStyle="Italic" Foreground="{StaticResource DataGridHeaderForegroundBrush}" Content="{x:Static p:Resources.Search}" />
                                <TextBox Name="txtSearch" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:SearchBox}, Mode=FindAncestor}, Path=SearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="320">
                                    <!--<i:Interaction.Triggers>
                                        <i:EventTrigger EventName="KeyDown">
                                            <si:InvokeDataCommand Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:SearchBox}, Mode=FindAncestor}, UpdateSourceTrigger=PropertyChanged, Path=Search}"/>
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>-->

                                    <TextBox.Style>
                                        <Style TargetType="TextBox">
                                            <Setter Property="Template" Value="{DynamicResource TextBoxBaseControlTemplate1}"/>
                                            <Setter Property="BorderBrush" Value="Transparent"/>
                                            <Setter Property="Background" Value="Transparent"/>
                                            <Setter Property="Margin" Value="1"/>
                                            <Style.Triggers>
                                                <Trigger Property="IsMouseOver" Value="True">
                                                    <Setter Property="BorderBrush" Value="Transparent"/>
                                                    <Setter Property="Background" Value="Transparent"/>
                                                </Trigger>
                                            </Style.Triggers>
                                        </Style>
                                    </TextBox.Style>
                                </TextBox>
                            </Grid>
                            <Button x:Name="btnSearch" HorizontalAlignment="Right" Height="24" Width="24" Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:SearchBox}, Mode=FindAncestor}, Path=Search}">
                                <Button.Style>
                                    <Style TargetType="Button">
                                        <Setter Property="Background" Value="{StaticResource AccentBrush}" />
                                        <Setter Property="BorderBrush" Value="White" />
                                    </Style>
                                </Button.Style>
                                <Button.Content>
                                    <Path Width="14" Height="14" Stretch="Fill" Fill="#FFFFFFFF" Data="F1 M 42.5,22C 49.4036,22 55,27.5964 55,34.5C 55,41.4036 49.4036,47 42.5,47C 40.1356,47 37.9245,46.3435 36,45.2426L 26.9749,54.2678C 25.8033,55.4393 23.9038,55.4393 22.7322,54.2678C 21.5607,53.0962 21.5607,51.1967 22.7322,50.0251L 31.7971,40.961C 30.6565,39.0755 30,36.8644 30,34.5C 30,27.5964 35.5964,22 42.5,22 Z M 42.5,26C 37.8056,26 34,29.8056 34,34.5C 34,39.1944 37.8056,43 42.5,43C 47.1944,43 51,39.1944 51,34.5C 51,29.8056 47.1944,26 42.5,26 Z "/>
                                </Button.Content>
                            </Button>
                        </StackPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
